﻿@using Sharp.Infrastructure
@model IndexViewModel
<ul class="nav navbar-nav">
    @if(WebServer.GetIP() == "127.0.0.1") {
    <li class="dropdown messages-menu">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <i class="fa fa-gavel"></i>
        </a>
        <ul class="dropdown-menu">
            <li>
                <ul class="menu">
                    <li>
                        <a href="@Url.Action("Index","Home",new { area = "OP"} )" target="_blank">
                            权限初始化
                        </a>
                    </li>
                </ul>
            </li>
        </ul>
    </li> 
    }
    <li class="dropdown messages-menu">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <i class="fa fa-envelope-o"></i>
            <span class="label label-success">@(Model.NoReadMessages.Count)</span>
        </a>
        <ul class="dropdown-menu">
            <li class="header">你有@(Model.NoReadMessages.Count)条消息</li>
            <li>
                <ul class="menu">
                    @foreach (var item in Model.NoReadMessages)
                    {
                        <li>
                            <a href="#">
                                <div class="pull-left">
                                    <img src="@Url.Content(item.Sender.Face)" class="img-circle" alt="@item.Sender.UserName">
                                </div>
                                <h4>
                                    @item.Sender.UserName
                                    <small><i class="fa fa-clock-o"></i> 5 mins</small>
                                </h4>
                                <p>@item.Content</p>
                            </a>
                        </li>
                    }
                </ul>
            </li>
            <li class="footer"><a href="@Url.Action("Index", "Message")" data-toggle="ajaxLoad">全部</a></li>
        </ul>
    </li>
    <li class="dropdown notifications-menu">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <i class="fa fa-bell-o"></i>
            <span class="label label-warning">@(Model.NoReadNotices.Count)</span>
        </a>
        <ul class="dropdown-menu">
            <li class="header">你有@(Model.NoReadNotices.Count)条通知</li>
            <li>

                <ul class="menu">
                    @foreach (var item in Model.NoReadNotices)
                    {
                        <li>
                            <a href="#">
                                <i class="fa fa-users text-aqua"></i> @item.Content
                            </a>
                        </li>
                    }
                </ul>
            </li>
            <li class="footer"><a href="@Url.Action("Index", "Notice")">全部</a></li>
        </ul>
    </li>

    <!-- User Account: style can be found in dropdown.less -->
    <li class="dropdown user user-menu">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <img src="@SharpUserManager.Current.Face" class="user-image" alt="User Image">
            <span class="hidden-xs">@SharpUserManager.Current.UserName</span>
        </a>
        <ul class="dropdown-menu">
            <!-- User image -->
            <li class="user-header">
                <img src="@SharpUserManager.Current.Face" class="img-circle" alt="用户头像">

                <p>
                    @SharpUserManager.Current.UserName
                    <small>角色： @string.Join("，", SharpUserManager.Current.RoleNames)</small>
                </p>
            </li>
            <!-- Menu Body -->
            <!-- Menu Footer-->
            <li class="user-footer">
                <div class="pull-left">
                    <a href="@Url.Action("Config", "User")" data-toggle="ajaxModal" class="btn btn-default btn-flat"><i class="fa fa-cog"></i> 配置</a>
                </div>
                <div class="pull-right">
                    <a href="@Url.Action("LogOff", "Account")" class="btn btn-default btn-flat"><i class="fa fa-power-off"></i> 注销登录</a>
                </div>
            </li>
        </ul>
    </li>
    <!-- Control Sidebar Toggle Button -->
    <li>
        <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
    </li>
</ul>
